Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jan 18, 2026

The action now supports explicit control over the release type through the new ReleaseType input parameter. The workflow has been restructured into separate initialization, publishing, and cleanup phases for improved modularity and conditional execution.

New ReleaseType input parameter

The ReleaseType input accepts the following values:

Value Description
Release Create a stable release (default)
Prerelease Create a prerelease
None Do not create any release

The cleanup of old prereleases is controlled separately via the existing AutoCleanup input.

Restructured workflow execution

The action is now split into three conditional phases:

  1. Initialize Publish Context (init.ps1) - Calculates version, validates inputs, and stores context in environment variables
  2. Publish Module (publish.ps1) - Downloads artifact, updates manifest, publishes to PSGallery, and creates GitHub release (only runs when ShouldPublish is true)
  3. Cleanup Prereleases (cleanup.ps1) - Deletes old prerelease tags (only runs when ShouldCleanup is true)

This separation allows the action to skip unnecessary steps (e.g., downloading artifacts when only cleanup is needed), and enables the abandoned PR cleanup scenario where a PR is closed without merging—the workflow can trigger cleanup independently of whether a release is being created.

Usage

The inputs work together with Get-PSModuleSettings which pre-calculates both values:

- uses: PSModule/Publish-PSModule@v2
  with:
    APIKey: ${{ secrets.PSGALLERY_API_KEY }}
    ReleaseType: ${{ fromJson(inputs.Settings).Publish.Module.ReleaseType }}
    AutoCleanup: ${{ fromJson(inputs.Settings).Publish.Module.AutoCleanup }}

Backward compatibility

The ReleaseType parameter defaults to Release, maintaining current behavior for merged PRs targeting the default branch.

@MariusStorhaug MariusStorhaug changed the title 🚀 [Feature]: Add ReleaseType input to Publish-PSModule for explicit release control 🌟 [Feature]: Make ReleaseType required input for explicit release control Jan 18, 2026
@MariusStorhaug MariusStorhaug changed the title 🌟 [Feature]: Make ReleaseType required input for explicit release control 🌟 [Major]: Make ReleaseType required input for explicit release control Jan 18, 2026
@MariusStorhaug MariusStorhaug changed the title 🌟 [Major]: Make ReleaseType required input for explicit release control 🌟 [Major]: Added ReleaseType input for explicit release control Jan 18, 2026
@MariusStorhaug MariusStorhaug changed the title 🌟 [Major]: Added ReleaseType input for explicit release control 🚀 [Feature]: Add ReleaseType input for explicit release control Jan 18, 2026
@MariusStorhaug MariusStorhaug marked this pull request as ready for review January 18, 2026 00:57
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner January 18, 2026 00:57
Copilot AI review requested due to automatic review settings January 18, 2026 00:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new ReleaseType input parameter that provides explicit control over release creation, replacing the previous automatic detection based on pull request state and branch information. The feature enables callers (typically Get-PSModuleSettings) to specify whether to create a Release, Prerelease, Cleanup, or None.

Changes:

  • Added ReleaseType input parameter to action.yml with default value 'Release'
  • Removed automatic detection logic for release types based on PR state, merge status, and target branch
  • Added validation for the ReleaseType parameter with support for four values: Release, Prerelease, Cleanup, None
  • Updated logging to display ReleaseType instead of PR state details

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
action.yml Adds ReleaseType input parameter definition and environment variable mapping
scripts/helpers/Publish-PSModule.ps1 Replaces automatic release type detection with explicit ReleaseType input handling and validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MariusStorhaug and others added 2 commits January 18, 2026 02:12
Copilot AI review requested due to automatic review settings January 18, 2026 01:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 18, 2026 03:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug MariusStorhaug changed the title 🚀 [Feature]: Add ReleaseType input for explicit release control 🚀 [Feature]: Add ReleaseType input and rename AutoCleanup to CleanupPrereleases Jan 18, 2026
Copilot AI review requested due to automatic review settings January 18, 2026 12:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug MariusStorhaug changed the title 🚀 [Feature]: Add ReleaseType input and rename AutoCleanup to CleanupPrereleases 🚀 [Feature]: Add ReleaseType input for explicit release control Jan 18, 2026
Copilot AI review requested due to automatic review settings January 18, 2026 14:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ewVersion and refactor manifest validation region
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 18, 2026 15:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 18, 2026 15:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants